package com.cheer.controller;


import com.cheer.common.Page;
import com.cheer.common.Result;
import com.cheer.security.UserInfoHolder;
import com.cheer.service.LecCourseService;
import com.cheer.service.LecIndexService;
import com.cheer.vo.IndexStatisticsVO;
import com.cheer.vo.LecCourseVO;
import com.cheer.vo.LecIndexOrgVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 用户信息
 *
 * @author cheer
 */
@RestController
@Api(tags = "首页")
@RequestMapping("/index")
public class LecIndexController {

    @Autowired
    private LecIndexService lecIndexService;

    @ApiOperation("静态统计")
    @GetMapping("/statistics")
    public Result<IndexStatisticsVO> statistics() {

        IndexStatisticsVO indexStatisticsVO = lecIndexService.statistics();
        return Result.success(indexStatisticsVO);
    }


    @ApiOperation("根据年份和机构")
    @GetMapping("/statisticsOrg")
    public Result<LecIndexOrgVO> statisticsOrg( @RequestParam("year") String year,
                                                @RequestParam("org") String org ) {

        LecIndexOrgVO LecIndexOrgVOs = lecIndexService.statisticsOrg(year, org);
        return Result.success(LecIndexOrgVOs);
    }

}
